fix(updater): harden failure paths, lock apt privilege behind a root-owned wrapper, and self-heal broken components#266
Merged
Conversation
…vision them in the same run
…helper wrapper and self-heal non-repo component dirs
HugoCLSC
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Select the type:
Updater hardening in three parts: failure-path robustness fixes from the dev review, apt privilege locked behind a root-owned wrapper, and self-healing for broken component directories (both RF50 field bugs).
Failure-path hardening
uv synccan neither abort the batch nor false-trip the UI's busy watchdog.git reset/checkouttimeouts raised 10s to 60s: they back rollback, boot revert, and recover, where a SIGTERM mid-checkout on a slow SD card is worst-case.OneShotTokenErrormessage is no longer lost.Scoped privilege
/usr/local/sbin/bs-apt-helperis the single apt/dpkg sudoers grant: fixed argv per verb plus package-name validation, closing the oldinstall --only-upgrade -y *option-injection window. It owns the dpkg-lock/conffile options andDEBIAN_FRONTEND(previously stripped by sudo env_reset).executor._apt_cmdroutes every apt operation through the wrapper; install-updater.sh deploys it before the daemon (re)starts, so there is no fallback path.git safe.directoryscoped to component repositories instead of'*'.Component self-heal
.git(tarball-installed ~/Spoolman) no longer aborts the whole update as a network error; it is excluded per-component and the batch proceeds.install_if_missingcomponents the directory is renamed to<name>.pre-updater-<timestamp>(reversible, old config preserved) and re-provisioned in the same run.